package com.founder.ivrapi.modular.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.founder.ivrapi.modular.entity.BaseBlackWhiteListEntity;
import com.founder.ivrapi.modular.mapper.BaseBlackWhiteListMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * base_black_white_list服务实现类
 */
@Service
public class BaseBlackWhiteListService extends ServiceImpl<BaseBlackWhiteListMapper, BaseBlackWhiteListEntity> {
	@Autowired
	private BaseBlackWhiteListMapper baseBlackWhiteListMapper;

	/**
	 * 判断呼入号码与落地号的对应关系
	 */
	public Object isphoneWhiteList(String called) {
		if(null == this.baseBlackWhiteListMapper.getPhoneIsWhiteListCount(called)){
			return false;
		}else{
			System.out.println("当前根据被叫："+called+"，获取到的落地号码是："+this.baseBlackWhiteListMapper.getPhoneIsWhiteListCount(called).getPhone());
			return this.baseBlackWhiteListMapper.getPhoneIsWhiteListCount(called).getPhone();
		}

	}
}
